.class public Lcom/burstly/lib/network/request/CurrencyRequestTask;
.super Lcom/burstly/lib/network/request/BurstlyRequestTask;
.source "CurrencyRequestTask.java"

# interfaces
.implements Lcom/burstly/lib/network/request/IRequestCallback;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<T:",
        "Ljava/lang/Object;",
        ">",
        "Lcom/burstly/lib/network/request/BurstlyRequestTask",
        "<TT;>;",
        "Lcom/burstly/lib/network/request/IRequestCallback",
        "<TT;>;"
    }
.end annotation


# static fields
.field private static final CURRENCY_REQUEST_TASK:Ljava/lang/String; = "CurrencyRequestTask"

.field private static final ENCRYPTION_KEY:Ljava/lang/String; = "CuRR3ncyAP!k#y\u0000\u0000"

.field private static final LOG:Lcom/burstly/lib/util/LoggerExt; = null

.field private static final MINUTE_TIMEOUT:I = 0xea60

.field private static final TAG:Ljava/lang/String; = "CurrencyRequestTask"


# instance fields
.field private mRequest:Ljava/lang/Object;

.field mResponse:Ljava/lang/Object;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "TT;"
        }
    .end annotation
.end field

.field private mSerializedRequest:Ljava/lang/String;

.field private mSleepInterval:J

.field private mUseEncryption:Z


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 45
    invoke-static {}, Lcom/burstly/lib/util/LoggerExt;->getInstance()Lcom/burstly/lib/util/LoggerExt;

    move-result-object v0

    sput-object v0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    return-void
.end method

.method public constructor <init>(Ljava/lang/Object;Ljava/lang/Class;)V
    .locals 3
    .parameter "request"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/Object;",
            "Ljava/lang/Class",
            "<TT;>;)V"
        }
    .end annotation

    .prologue
    .line 103
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    .local p2, convertClass:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    const/4 v0, 0x0

    sget-object v1, Lcom/burstly/lib/constants/UriConstants;->CURRENCY_SECURED_POINT:Ljava/lang/String;

    const-string v2, "CurrencyRequestTask"

    invoke-direct {p0, v0, v1, p2, v2}, Lcom/burstly/lib/network/request/BurstlyRequestTask;-><init>(Lcom/burstly/lib/network/beans/cookie/ICookieRequest;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;)V

    .line 104
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mUseEncryption:Z

    .line 105
    invoke-direct {p0, p1}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->setUpRequestTask(Ljava/lang/Object;)V

    .line 106
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->setUseRequestCycle(Z)V

    .line 107
    invoke-static {}, Lcom/burstly/lib/service/HostsProviderManager;->getCurrencyProvider()Lcom/burstly/lib/service/IHostProvider;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->setHostProvider(Lcom/burstly/lib/service/IHostProvider;)V

    .line 108
    return-void
.end method

.method public constructor <init>(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Class;)V
    .locals 2
    .parameter "uri"
    .parameter "request"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/lang/Object;",
            "Ljava/lang/Class",
            "<TT;>;)V"
        }
    .end annotation

    .prologue
    .line 90
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    .local p3, convertClass:Ljava/lang/Class;,"Ljava/lang/Class<TT;>;"
    const/4 v0, 0x0

    const-string v1, "CurrencyRequestTask"

    invoke-direct {p0, v0, p1, p3, v1}, Lcom/burstly/lib/network/request/BurstlyRequestTask;-><init>(Lcom/burstly/lib/network/beans/cookie/ICookieRequest;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;)V

    .line 91
    invoke-direct {p0, p2}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->setUpRequestTask(Ljava/lang/Object;)V

    .line 92
    return-void
.end method

.method private static removeTrailingZeroBytes(Ljava/lang/String;)Ljava/lang/String;
    .locals 3
    .parameter "string"

    .prologue
    const/4 v2, 0x0

    .line 153
    invoke-virtual {p0, v2}, Ljava/lang/String;->indexOf(I)I

    move-result v0

    .line 154
    .local v0, firsZeroByte:I
    const/4 v1, -0x1

    if-eq v0, v1, :cond_0

    .line 155
    invoke-virtual {p0, v2, v0}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p0

    .line 157
    .end local p0
    :cond_0
    return-object p0
.end method

.method private setUpRequestTask(Ljava/lang/Object;)V
    .locals 2
    .parameter "request"

    .prologue
    .line 116
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    invoke-virtual {p0, p1}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->setRequest(Ljava/lang/Object;)V

    .line 117
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->setCanBeAborted(Z)V

    .line 118
    invoke-virtual {p0, p0}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->setCallback(Lcom/burstly/lib/network/request/IRequestCallback;)V

    .line 119
    const-wide/32 v0, 0xea60

    iput-wide v0, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSleepInterval:J

    .line 120
    return-void
.end method


# virtual methods
.method protected convertServerResponse(Ljava/lang/String;)Ljava/lang/Object;
    .locals 4
    .parameter "response"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")TT;"
        }
    .end annotation

    .prologue
    .line 130
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    if-nez p1, :cond_0

    .line 131
    const/4 v2, 0x0

    .line 143
    :goto_0
    return-object v2

    .line 133
    :cond_0
    const-string v2, "\""

    const-string v3, ""

    invoke-virtual {p1, v2, v3}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 134
    .local v1, responseStr:Ljava/lang/String;
    iget-boolean v2, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mUseEncryption:Z

    if-eqz v2, :cond_1

    .line 136
    :try_start_0
    const-string v2, "CuRR3ncyAP!k#y\u0000\u0000"

    invoke-static {v2, v1}, Lcom/burstly/lib/util/Utils;->decrypt(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    .line 142
    :cond_1
    :goto_1
    invoke-static {v1}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->removeTrailingZeroBytes(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 143
    invoke-virtual {p0}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->getTartgetClass()Ljava/lang/Class;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/burstly/lib/util/Utils;->fromJson(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v2

    goto :goto_0

    .line 138
    :catch_0
    move-exception v0

    .line 139
    .local v0, e:Ljava/lang/Exception;
    sget-object v2, Lcom/burstly/lib/network/request/CurrencyRequestTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v3, "CurrencyRequestTask"

    invoke-virtual {v2, v3, v0}, Lcom/burstly/lib/util/LoggerExt;->logThrowable(Ljava/lang/String;Ljava/lang/Throwable;)V

    goto :goto_1
.end method

.method public executeInThisThread()Ljava/lang/Object;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()TT;"
        }
    .end annotation

    .prologue
    .line 185
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    const/4 v0, 0x0

    new-array v0, v0, [Ljava/lang/Void;

    invoke-virtual {p0, v0}, Lcom/burstly/lib/network/request/CurrencyRequestTask;->doInBackground([Ljava/lang/Void;)Ljava/lang/Object;

    .line 186
    iget-object v0, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mResponse:Ljava/lang/Object;

    return-object v0
.end method

.method public bridge synthetic getCallback()Lcom/burstly/lib/network/request/IRequestCallback;
    .locals 1

    .prologue
    .line 30
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    invoke-super {p0}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->getCallback()Lcom/burstly/lib/network/request/IRequestCallback;

    move-result-object v0

    return-object v0
.end method

.method protected getDataToPost()Ljava/lang/String;
    .locals 3

    .prologue
    .line 162
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    iget-object v1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSerializedRequest:Ljava/lang/String;

    if-nez v1, :cond_1

    .line 164
    :try_start_0
    iget-object v1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mRequest:Ljava/lang/Object;

    invoke-static {v1}, Lcom/burstly/lib/util/Utils;->toJson(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSerializedRequest:Ljava/lang/String;

    .line 165
    iget-boolean v1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mUseEncryption:Z

    if-eqz v1, :cond_0

    .line 166
    const-string v1, "CuRR3ncyAP!k#y\u0000\u0000"

    iget-object v2, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSerializedRequest:Ljava/lang/String;

    invoke-static {v1, v2}, Lcom/burstly/lib/util/Utils;->encryp(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSerializedRequest:Ljava/lang/String;

    .line 167
    new-instance v1, Lcom/burstly/lib/currency/request/RequestWrapper;

    iget-object v2, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSerializedRequest:Ljava/lang/String;

    invoke-direct {v1, v2}, Lcom/burstly/lib/currency/request/RequestWrapper;-><init>(Ljava/lang/Object;)V

    invoke-static {v1}, Lcom/burstly/lib/util/Utils;->toJson(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSerializedRequest:Ljava/lang/String;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 174
    :cond_0
    :goto_0
    const/4 v1, 0x0

    iput-object v1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mRequest:Ljava/lang/Object;

    .line 176
    :cond_1
    iget-object v1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSerializedRequest:Ljava/lang/String;

    return-object v1

    .line 170
    :catch_0
    move-exception v0

    .line 171
    .local v0, e:Ljava/lang/Exception;
    sget-object v1, Lcom/burstly/lib/network/request/CurrencyRequestTask;->LOG:Lcom/burstly/lib/util/LoggerExt;

    const-string v2, "CurrencyRequestTask"

    invoke-virtual {v1, v2, v0}, Lcom/burstly/lib/util/LoggerExt;->logThrowable(Ljava/lang/String;Ljava/lang/Throwable;)V

    .line 172
    const-string v1, ""

    iput-object v1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSerializedRequest:Ljava/lang/String;

    goto :goto_0
.end method

.method protected getRequest()Ljava/lang/Object;
    .locals 1

    .prologue
    .line 229
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    iget-object v0, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mRequest:Ljava/lang/Object;

    return-object v0
.end method

.method protected getSleepBetweenRequestCycles()J
    .locals 4

    .prologue
    .line 124
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    iget-wide v0, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSleepInterval:J

    const-wide/16 v2, 0x2

    mul-long/2addr v0, v2

    iput-wide v0, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSleepInterval:J

    .line 125
    iget-wide v0, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mSleepInterval:J

    return-wide v0
.end method

.method public bridge synthetic getTartgetClass()Ljava/lang/Class;
    .locals 1

    .prologue
    .line 30
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    invoke-super {p0}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->getTartgetClass()Ljava/lang/Class;

    move-result-object v0

    return-object v0
.end method

.method public onFailInBackground(Ljava/lang/Object;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .line 200
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    .local p1, processResult:Ljava/lang/Object;,"TT;"
    return-void
.end method

.method public onFailUi(Ljava/lang/Object;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .line 204
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    .local p1, param:Ljava/lang/Object;,"TT;"
    return-void
.end method

.method public onNoConnection()V
    .locals 0

    .prologue
    .line 208
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    return-void
.end method

.method public onSuccessInBackground(Ljava/lang/Object;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .line 212
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    .local p1, processResult:Ljava/lang/Object;,"TT;"
    iput-object p1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mResponse:Ljava/lang/Object;

    .line 213
    return-void
.end method

.method public onSuccessUi(Ljava/lang/Object;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TT;)V"
        }
    .end annotation

    .prologue
    .line 217
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    .local p1, param:Ljava/lang/Object;,"TT;"
    return-void
.end method

.method public preExecute()V
    .locals 0

    .prologue
    .line 221
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    return-void
.end method

.method public bridge synthetic setCallback(Lcom/burstly/lib/network/request/IRequestCallback;)V
    .locals 0
    .parameter "x0"

    .prologue
    .line 30
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    invoke-super {p0, p1}, Lcom/burstly/lib/network/request/BurstlyRequestTask;->setCallback(Lcom/burstly/lib/network/request/IRequestCallback;)V

    return-void
.end method

.method protected setRequest(Ljava/lang/Object;)V
    .locals 0
    .parameter "request"

    .prologue
    .line 238
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    iput-object p1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mRequest:Ljava/lang/Object;

    .line 239
    return-void
.end method

.method public setUseEncryption(Z)V
    .locals 0
    .parameter "useEncryption"

    .prologue
    .line 195
    .local p0, this:Lcom/burstly/lib/network/request/CurrencyRequestTask;,"Lcom/burstly/lib/network/request/CurrencyRequestTask<TT;>;"
    iput-boolean p1, p0, Lcom/burstly/lib/network/request/CurrencyRequestTask;->mUseEncryption:Z

    .line 196
    return-void
.end method
